package com.rongshe.hotel.service.impl;

import java.util.List;
import com.rongshe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rongshe.hotel.mapper.RsUserMapper;
import com.rongshe.hotel.domain.RsUser;
import com.rongshe.hotel.service.IRsUserService;

/**
 * 用户Service业务层处理
 * 
 * @author rongshe
 * @date 2025-02-18
 */
@Service
public class RsUserServiceImpl implements IRsUserService 
{
    @Autowired
    private RsUserMapper rsUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public RsUser selectRsUserById(Long id)
    {
        return rsUserMapper.selectRsUserById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param rsUser 用户
     * @return 用户
     */
    @Override
    public List<RsUser> selectRsUserList(RsUser rsUser)
    {
        return rsUserMapper.selectRsUserList(rsUser);
    }

    /**
     * 新增用户
     * 
     * @param rsUser 用户
     * @return 结果
     */
    @Override
    public int insertRsUser(RsUser rsUser)
    {
        rsUser.setCreateTime(DateUtils.getNowDate());
        return rsUserMapper.insertRsUser(rsUser);
    }

    /**
     * 修改用户
     * 
     * @param rsUser 用户
     * @return 结果
     */
    @Override
    public int updateRsUser(RsUser rsUser)
    {
        rsUser.setUpdateTime(DateUtils.getNowDate());
        return rsUserMapper.updateRsUser(rsUser);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteRsUserByIds(Long[] ids)
    {
        return rsUserMapper.deleteRsUserByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteRsUserById(Long id)
    {
        return rsUserMapper.deleteRsUserById(id);
    }
}
